<template>
  <div class="page_padding">
    <MyNavBar @goback="goback" :title="title" />
    <!-- 考勤汇总 -个人-->
    <StaticsGatherMan v-if="$route.query.pageTypes === '1'" />
    <!-- 考勤明细 -->
    <StaticsOneGather v-if="$route.query.pageTypes === '2'" />
    <!-- 考勤汇总 -部门-->
    <StaticsGatherOrg v-if="$route.query.pageTypes === '3'" />
    <!-- 局领导-点击单个部门-->
    <StaticsGatherOneOrg v-if="$route.query.pageTypes === '4'" />
  </div>
</template>

<script>
import MyNavBar from '@com/MyNavBar'
import StaticsGatherMan from './dutyStaticsNew/StaticsGatherMan'
import StaticsOneGather from './dutyStaticsNew/StaticsOneGather'
import StaticsGatherOrg from './dutyStaticsNew/StaticsGatherOrg'
import StaticsGatherOneOrg from './dutyStaticsNew/StaticsGatherOneOrg'
import {} from '@api/api.js'
export default {
  name: 'OutAllPages',
  components: {
    MyNavBar,
    StaticsGatherMan,
    StaticsOneGather,
    StaticsGatherOrg,
    StaticsGatherOneOrg,
  },
  data() {
    return {
      title: '',
    }
  },
  watch: {
    $route: {
      handler(news) {
        sessionStorage.removeItem('staticsInfo')
        switch (news.query.pageTypes) {
          case '1':
            return (this.title = '考勤汇总')
          case '2':
            return (this.title = '考勤明细')
          case '3':
            return (this.title = '考勤汇总')
          case '4':
            return (this.title = JSON.parse(news.query.item).orgName + '考勤统计')
          default:
            break
        }
      },
      deep: true,
      immediate: true,
    },
  },
  created() {},
  mounted() {},
  methods: {
    goback() {
      this.$router.go(-1)
    },
  },
}
</script>

<style lang="scss" scoped></style>
